/*
 * @file iso9660.h
 *
 *  ISO9660 filesystem interface with source volumes
 *
 */

#ifndef __ISO9660_IO_H_
#define __ISO9660_IO_H_

#include <rtems.h>
#include <rtems/libio_.h>

#include "iso9660.h"

#ifdef __cplusplus
extern "C" {
#endif

extern int
iso9660_buffer_open(
    struct stat       *host_volume,
    iso9660_fs_info_t  *fs_info
);

extern int
iso9660_buffer_acquire(
    iso9660_fs_info_t      *fs,
    uint32_t                block,
    rtems_bdbuf_buffer    **buffer
);

extern int
iso9660_buffer_release(
    iso9660_fs_info_t  *fs,
    rtems_bdbuf_buffer *buffer
);

extern int
iso9660_regular_open(
    char              *device,
    struct stat       *host_volume,
    iso9660_fs_info_t  *fs
);

extern ssize_t
iso9660_read_sector(
    iso9660_fs_info_t    *fs,
    uint32_t              sector_num,
    uint32_t              offset,
    uint32_t              count,
    void                 *buffer
);

extern int
iso9660_lookup_node_in_record(
    iso9660_fs_info_t           *fs,
    const char                 *node,
    int                          node_len,
    iso9660_directory_record_t  *record,
    iso9660_extent_t            *extent
);

#ifdef __cplusplus
}
#endif

#endif /* __ISO9660_IO_H_ */
